from collections.abc import Iterator
from collections.abc import Iterable

i = (x for x in [23, 56, 598])
print(next(i))

a = iter([1, 2, 5, 5, 6, 7])
print(next(a))

# 使用迭代器
endStr = "end"
str = ""

for line in iter(input, endStr):
    str += line + "\n"
print(str)




